<?php
namespace Home\Controller;
use Think\Controller;
class ClubController extends Controller {
	public function getIsPostRequest(){
        return isset($_SERVER['REQUEST_METHOD']) && !strcasecmp($_SERVER['REQUEST_METHOD'],'POST');
	}

    public function getAllClub(){
         $club=M('club');
	   $data=$club->order('cid asc')->select();
	   echo json_encode($data);
    }
     public function getClubById(){
     	if(getIsPostRequest()){
        $cid=$_GET['cid'];
       	}
        else{
        $cid=$_POST['cid'];  
        }
        $club=M('club');
        $data=$club->where("cid=$cid")->select();
        echo json_encode($data);
    }

}